//
//  WYCBankaController.m
//  快付钱包
//
//  Created by 中企互联 on 2018/1/12.
//  Copyright © 2018年 中企互联. All rights reserved.
//

#import "WYCBankaController.h"
#import "WYCXingyeController.h"
#import "WYCPufaViewController.h"
#import "WYCZhongxinViewController.h"
#import "WYCZhaoshangViewController.h"
#import "WYCPinganController.h"
#import "WYCJiaotongController.h"

@interface WYCBankaController ()<UIWebViewDelegate>
@property(nonatomic,strong)UIWebView * webView;


@property(nonatomic,strong)CALayer *bottomLineLayer;
@end

@implementation WYCBankaController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.navigationItem.title = @"办卡";
//    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
//    [self.navigationController.navigationBar setBarTintColor:WYCMain];
    
//    if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
//        self.edgesForExtendedLayout = UIRectEdgeNone;
//    }
    
    [self setcreat];
}

- (void)setcreat{
    
    self.view.backgroundColor = [UIColor whiteColor];
//    CGFloat tableviewY = CGRectGetMaxY(self.navigationController.navigationBar.frame);
    _webView = [[UIWebView alloc] init];
    _webView.frame = CGRectMake(0, NavHeight, ScreenWidth, ScreenHeight - (NavHeight));
    _webView.delegate = self;
    _webView.backgroundColor = [UIColor whiteColor];
    
    
    //请求协议
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://shop13288791.wxrrd.com/feature/10304581"]]]];
    [self.view addSubview:_webView];
    
//    CGFloat tableviewY = CGRectGetMaxY(self.navigationController.navigationBar.frame);
    
//    UIImageView * xingyeimageView = [[UIImageView alloc] init];
//    xingyeimageView.image = [UIImage imageNamed:@"兴业银行"];
//    xingyeimageView.frame = CGRectMake(40 * px, tableviewY + 40 * px, 120 * px, 120 * px);
//    [self.view addSubview:xingyeimageView];
//
//    UILabel * xingyelabel = [[UILabel alloc] init];
//    xingyelabel.frame = CGRectMake(CGRectGetMaxX(xingyeimageView.frame) + 40 * px, xingyeimageView.y - 20 * px, 300 * px, 50 * px);
//    xingyelabel.text = @"兴业银行";
//    xingyelabel.textColor = [UIColor grayColor];
//    xingyelabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [self.view addSubview:xingyelabel];
//
//    UILabel * bigxingyelabel = [[UILabel alloc] init];
//    bigxingyelabel.frame = CGRectMake(xingyelabel.x, CGRectGetMaxY(xingyelabel.frame) + 20 * px, 300 * px, 60 * px);
//    bigxingyelabel.text = @"兴业银行";
//    bigxingyelabel.textColor = [UIColor grayColor];
//    bigxingyelabel.font = [UIFont systemFontOfSize:SmallFont];
//    [self.view addSubview:bigxingyelabel];
//
//
//    UIButton * xingyebutton = [[UIButton alloc] init];
//    xingyebutton.frame = CGRectMake(ScreenWidth - 300 * px, xingyeimageView.y, 260 * px, 80 * px);
//    [xingyebutton addTarget:self action:@selector(xingyeclick) forControlEvents:UIControlEventTouchUpInside];
//    xingyebutton.layer.cornerRadius = 40 * px;
//    xingyebutton.backgroundColor = WYCMain;
//    xingyebutton.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [xingyebutton setTitle:@"申请" forState:UIControlStateNormal];
//    [xingyebutton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [self.view addSubview:xingyebutton];
//
//
//    UIView * xingyeline = [[UIView alloc] init];
//    xingyeline.frame = CGRectMake(xingyeimageView.x, CGRectGetMaxY(xingyeimageView.frame) + 40 * px, ScreenWidth - 80 * px, 0.5);
//    xingyeline.backgroundColor = [UIColor grayColor];
//    [self.view addSubview:xingyeline];
//
//
//
//    /***************浦发**********/
//
//    UIImageView * pufaimageView = [[UIImageView alloc] init];
//    pufaimageView.image = [UIImage imageNamed:@"浦发银行"];
//    pufaimageView.frame = CGRectMake(40 * px, CGRectGetMaxY(xingyeline.frame) + 40 * px, 120 * px, 120 * px);
//    [self.view addSubview:pufaimageView];
//
//    UILabel * pufalabel = [[UILabel alloc] init];
//    pufalabel.frame = CGRectMake(CGRectGetMaxX(pufaimageView.frame) + 40 * px, pufaimageView.y - 20 * px, 300 * px, 50 * px);
//    pufalabel.text = @"浦发银行";
//    pufalabel.textColor = [UIColor grayColor];
//    pufalabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [self.view addSubview:pufalabel];
//
//    UILabel * bigpufalabel = [[UILabel alloc] init];
//    bigpufalabel.frame = CGRectMake(pufalabel.x, CGRectGetMaxY(pufalabel.frame) + 20 * px, 300 * px, 60 * px);
//    bigpufalabel.text = @"兴业银行";
//    bigpufalabel.textColor = [UIColor grayColor];
//    bigpufalabel.font = [UIFont systemFontOfSize:SmallFont];
//    [self.view addSubview:bigpufalabel];
//
//
//    UIButton * pufabutton = [[UIButton alloc] init];
//    pufabutton.frame = CGRectMake(ScreenWidth - 300 * px, pufaimageView.y, 260 * px, 80 * px);
//    pufabutton.layer.cornerRadius = 40 * px;
//    pufabutton.backgroundColor = WYCMain;
//    pufabutton.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [pufabutton addTarget:self action:@selector(pufaClick) forControlEvents:UIControlEventTouchUpInside];
//    [pufabutton setTitle:@"申请" forState:UIControlStateNormal];
//    [pufabutton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [self.view addSubview:pufabutton];
//
//
//    UIView * pufabuline = [[UIView alloc] init];
//    pufabuline.frame = CGRectMake(pufaimageView.x, CGRectGetMaxY(pufaimageView.frame) + 40 * px, ScreenWidth - 80 * px, 0.5);
//    pufabuline.backgroundColor = [UIColor grayColor];
//    [self.view addSubview:pufabuline];
//
//
//    /***************中信**********/
//
//    UIImageView * zhongxinimageView = [[UIImageView alloc] init];
//    zhongxinimageView.image = [UIImage imageNamed:@"中信银行"];
//    zhongxinimageView.frame = CGRectMake(40 * px, CGRectGetMaxY(pufabuline.frame) + 40 * px, 120 * px, 120 * px);
//    [self.view addSubview:zhongxinimageView];
//
//    UILabel * zhongxinlabel = [[UILabel alloc] init];
//    zhongxinlabel.frame = CGRectMake(CGRectGetMaxX(zhongxinimageView.frame) + 40 * px, zhongxinimageView.y - 20 * px, 300 * px, 50 * px);
//    zhongxinlabel.text = @"中信银行";
//    zhongxinlabel.textColor = [UIColor grayColor];
//    zhongxinlabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [self.view addSubview:zhongxinlabel];
//
//    UILabel * bigzhongxinlabel = [[UILabel alloc] init];
//    bigzhongxinlabel.frame = CGRectMake(zhongxinlabel.x, CGRectGetMaxY(zhongxinlabel.frame) + 20 * px, 300 * px, 60 * px);
//    bigzhongxinlabel.text = @"兴业银行";
//    bigzhongxinlabel.textColor = [UIColor grayColor];
//    bigzhongxinlabel.font = [UIFont systemFontOfSize:SmallFont];
//    [self.view addSubview:bigzhongxinlabel];
//
//
//    UIButton * zhongxinbutton = [[UIButton alloc] init];
//    zhongxinbutton.frame = CGRectMake(ScreenWidth - 300 * px, zhongxinimageView.y, 260 * px, 80 * px);
//    zhongxinbutton.layer.cornerRadius = 40 * px;
//    zhongxinbutton.backgroundColor = WYCMain;
//    [zhongxinbutton addTarget:self action:@selector(zhongxinClick) forControlEvents:UIControlEventTouchUpInside];
//    zhongxinbutton.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [zhongxinbutton setTitle:@"申请" forState:UIControlStateNormal];
//    [zhongxinbutton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [self.view addSubview:zhongxinbutton];
//
//
//    UIView * zhongxinbuline = [[UIView alloc] init];
//    zhongxinbuline.frame = CGRectMake(zhongxinimageView.x, CGRectGetMaxY(zhongxinimageView.frame) + 40 * px, ScreenWidth - 80 * px, 0.5);
//    zhongxinbuline.backgroundColor = [UIColor grayColor];
//    [self.view addSubview:zhongxinbuline];
//
//
//
//    /***************招商**********/
//
//    UIImageView * zhaoshangimageView = [[UIImageView alloc] init];
//    zhaoshangimageView.image = [UIImage imageNamed:@"招商银行"];
//    zhaoshangimageView.frame = CGRectMake(40 * px, CGRectGetMaxY(zhongxinbuline.frame) + 40 * px, 120 * px, 120 * px);
//    [self.view addSubview:zhaoshangimageView];
//
//    UILabel * zhaoshanglabel = [[UILabel alloc] init];
//    zhaoshanglabel.frame = CGRectMake(CGRectGetMaxX(zhaoshangimageView.frame) + 40 * px, zhaoshangimageView.y - 20 * px, 300 * px, 50 * px);
//    zhaoshanglabel.text = @"招商银行";
//    zhaoshanglabel.textColor = [UIColor grayColor];
//    zhaoshanglabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [self.view addSubview:zhaoshanglabel];
//
//    UILabel * bigzhaoshanglabel = [[UILabel alloc] init];
//    bigzhaoshanglabel.frame = CGRectMake(zhaoshanglabel.x, CGRectGetMaxY(zhaoshanglabel.frame) + 20 * px, 300 * px, 60 * px);
//    bigzhaoshanglabel.text = @"兴业银行";
//    bigzhaoshanglabel.textColor = [UIColor grayColor];
//    bigzhaoshanglabel.font = [UIFont systemFontOfSize:SmallFont];
//    [self.view addSubview:bigzhaoshanglabel];
//
//
//    UIButton * zhaoshangbutton = [[UIButton alloc] init];
//    zhaoshangbutton.frame = CGRectMake(ScreenWidth - 300 * px, zhaoshangimageView.y, 260 * px, 80 * px);
//    [zhaoshangbutton addTarget:self action:@selector(zhaoshangClick) forControlEvents:UIControlEventTouchUpInside];
//    zhongxinbutton.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
//    zhaoshangbutton.layer.cornerRadius = 40 * px;
//    zhaoshangbutton.backgroundColor = WYCMain;
//    zhaoshangbutton.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [zhaoshangbutton setTitle:@"申请" forState:UIControlStateNormal];
//    [zhaoshangbutton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [self.view addSubview:zhaoshangbutton];
//
//
//    UIView * zhaoshangbuline = [[UIView alloc] init];
//    zhaoshangbuline.frame = CGRectMake(zhaoshangimageView.x, CGRectGetMaxY(zhaoshangimageView.frame) + 40 * px, ScreenWidth - 80 * px, 0.5);
//    zhaoshangbuline.backgroundColor = [UIColor grayColor];
//    [self.view addSubview:zhaoshangbuline];
//
//
//    /***************平安**********/
//
//    UIImageView * pinganimageView = [[UIImageView alloc] init];
//    pinganimageView.image = [UIImage imageNamed:@"平安银行"];
//    pinganimageView.frame = CGRectMake(40 * px, CGRectGetMaxY(zhaoshangbuline.frame) + 40 * px, 120 * px, 120 * px);
//    [self.view addSubview:pinganimageView];
//
//    UILabel * pinganlabel = [[UILabel alloc] init];
//    pinganlabel.frame = CGRectMake(CGRectGetMaxX(pinganimageView.frame) + 40 * px, pinganimageView.y - 20 * px, 300 * px, 50 * px);
//    pinganlabel.text = @"平安银行";
//    pinganlabel.textColor = [UIColor grayColor];
//    pinganlabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [self.view addSubview:pinganlabel];
//
//    UILabel * bigpinganlabel = [[UILabel alloc] init];
//    bigpinganlabel.frame = CGRectMake(pinganlabel.x, CGRectGetMaxY(pinganlabel.frame) + 20 * px, 300 * px, 60 * px);
//    bigpinganlabel.text = @"兴业银行";
//    bigpinganlabel.textColor = [UIColor grayColor];
//    bigpinganlabel.font = [UIFont systemFontOfSize:SmallFont];
//    [self.view addSubview:bigpinganlabel];
//
//
//    UIButton * pinganbutton = [[UIButton alloc] init];
//    pinganbutton.frame = CGRectMake(ScreenWidth - 300 * px, pinganimageView.y, 260 * px, 80 * px);
//    [pinganbutton addTarget:self action:@selector(pinganClick) forControlEvents:UIControlEventTouchUpInside];
//    pinganbutton.layer.cornerRadius = 40 * px;
//    pinganbutton.backgroundColor = WYCMain;
//    pinganbutton.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [pinganbutton setTitle:@"申请" forState:UIControlStateNormal];
//    [pinganbutton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [self.view addSubview:pinganbutton];
//
//
//    UIView * pinganbuline = [[UIView alloc] init];
//    pinganbuline.frame = CGRectMake(pinganimageView.x, CGRectGetMaxY(pinganimageView.frame) + 40 * px, ScreenWidth - 80 * px, 0.5);
//    pinganbuline.backgroundColor = [UIColor grayColor];
//    [self.view addSubview:pinganbuline];
//
//
//
//    /***************交通**********/
//
//    UIImageView * jiaotongimageView = [[UIImageView alloc] init];
//    jiaotongimageView.image = [UIImage imageNamed:@"交通银行"];
//    jiaotongimageView.frame = CGRectMake(40 * px, CGRectGetMaxY(pinganbuline.frame) + 40 * px, 120 * px, 120 * px);
//    [self.view addSubview:jiaotongimageView];
//
//    UILabel * jiaotonglabel = [[UILabel alloc] init];
//    jiaotonglabel.frame = CGRectMake(CGRectGetMaxX(jiaotongimageView.frame) + 40 * px, jiaotongimageView.y - 20 * px, 300 * px, 50 * px);
//    jiaotonglabel.text = @"交通银行";
//    jiaotonglabel.textColor = [UIColor grayColor];
//    jiaotonglabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [self.view addSubview:jiaotonglabel];
//
//    UILabel * bigjiaotonglabel = [[UILabel alloc] init];
//    bigjiaotonglabel.frame = CGRectMake(jiaotonglabel.x, CGRectGetMaxY(jiaotonglabel.frame) + 20 * px, 300 * px, 60 * px);
//    bigjiaotonglabel.text = @"兴业银行";
//    bigjiaotonglabel.textColor = [UIColor grayColor];
//    bigjiaotonglabel.font = [UIFont systemFontOfSize:SmallFont];
//    [self.view addSubview:bigjiaotonglabel];
//
//
//    UIButton * jiaotongbutton = [[UIButton alloc] init];
//    jiaotongbutton.frame = CGRectMake(ScreenWidth - 300 * px, jiaotongimageView.y, 260 * px, 80 * px);
//    [jiaotongbutton addTarget:self action:@selector(jiaotongClick) forControlEvents:UIControlEventTouchUpInside];
//    jiaotongbutton.layer.cornerRadius = 40 * px;
//    jiaotongbutton.backgroundColor = WYCMain;
//    jiaotongbutton.titleLabel.font = [UIFont systemFontOfSize:MiddleFont];
//    [jiaotongbutton setTitle:@"申请" forState:UIControlStateNormal];
//    [jiaotongbutton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [self.view addSubview:jiaotongbutton];
//
//
//    UIView * jiaotongbuline = [[UIView alloc] init];
//    jiaotongbuline.frame = CGRectMake(jiaotongimageView.x, CGRectGetMaxY(jiaotongimageView.frame) + 40 * px, ScreenWidth - 80 * px, 0.5);
//    jiaotongbuline.backgroundColor = [UIColor grayColor];
//    [self.view addSubview:jiaotongbuline];
//
//}
//- (void)jiaotongClick{
//
//    WYCJiaotongController * pufa = [[WYCJiaotongController alloc] init];
//    [self.navigationController pushViewController:pufa animated:NO];
//}
//- (void)pinganClick{
//
//    WYCPinganController * pufa = [[WYCPinganController alloc] init];
//    [self.navigationController pushViewController:pufa animated:NO];
//}
//- (void)zhaoshangClick{
//
//    WYCZhaoshangViewController * pufa = [[WYCZhaoshangViewController alloc] init];
//    [self.navigationController pushViewController:pufa animated:NO];
//}
//- (void)zhongxinClick{
//
//    WYCZhongxinViewController * pufa = [[WYCZhongxinViewController alloc] init];
//    [self.navigationController pushViewController:pufa animated:NO];
//}
//- (void)pufaClick{
//
//    WYCPufaViewController * pufa = [[WYCPufaViewController alloc] init];
//    [self.navigationController pushViewController:pufa animated:NO];
//}
//- (void)xingyeclick{
//    WYCXingyeController *xingye = [[WYCXingyeController alloc] init];
//    [self.navigationController pushViewController:xingye animated:NO];
    
}
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBar.hidden = YES;
    
    
    UIView * NavView = [[UIView alloc] init];
    NavView.frame = CGRectMake(0, 0, ScreenWidth, NavHeight);
    NavView.backgroundColor = WYCMain;
    [self.view addSubview:NavView];
    
    
    
    self.bottomLineLayer = [[CALayer alloc] init];
    self.bottomLineLayer.frame = CGRectMake(0, NavView.bounds.size.height - 0.5, NavView.bounds.size.width, 0.5);
    self.bottomLineLayer.backgroundColor = WYCRGBColor(191, 191, 196).CGColor;
    [NavView.layer addSublayer:self.bottomLineLayer];
    
    
    //返回按钮
    UIButton *  backbutton = [[UIButton alloc] init];
    [backbutton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
    [backbutton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    backbutton.frame = CGRectMake(30 * px, titleY, 66 * px , 66 * px);
    [NavView addSubview:backbutton];
    
    
    UILabel * NavRigsterLabel = [[UILabel alloc] init];
    NavRigsterLabel.frame = CGRectMake(0, titleY, NavView.width, 68 * px);
    NavRigsterLabel.textColor = [UIColor whiteColor];
    NavRigsterLabel.font = [UIFont boldSystemFontOfSize:BigFont];
    NavRigsterLabel.textAlignment = NSTextAlignmentCenter;
    NavRigsterLabel.text = @"办卡";
    [NavView addSubview:NavRigsterLabel];
}
- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}
@end
